import { Http } from "@/utils/request";
import { Toast } from "@/utils/toast";
import { delayTask } from "@/utils/timer";

const baseUrl = "/course_order";

export const share_check_api = (
  data: { share_uid: string; product_no: string },
  showError = true
) => {
  return Http.get(`${baseUrl}/share_check`, data).catch((error: Error) => {
    showError && delayTask(60, () => Toast.show(error.message));
    return Promise.reject(error);
  });
};
